import pygame
import sys
#GLOBAL VARIABLES
width, height = 800, 600

BLACK = (0,0,0)
WHITE = (255,255,255)
GREY = (88,88,88)
GREY_DARKER = (100,100,100)

boat = pygame.image.load("./images/Boat.png")
#boat.set_colorkey(WHITE)
boat = pygame.transform.scale(boat, (40,40))

background_river = pygame.image.load("./images/Background1.png")

class Rectangle:
	def __init__(self, x, y, width, height):
		self.x = x
		self.y = y
		self.width = width
		self.height = height

	def draw(self, displ):
		#rect = pygame.draw.rect(disp, BLACK, (self.x, self.y), (self.width, self.height))
		rect = pygame.Rect(self.x, self.y, self.width, self.height)
		pygame.draw.rect(displ, GREY, rect)

def initialize():
	pygame.init()
	window = pygame.display.set_mode((width, height))
	return window

def main(window):
	disp = pygame.Surface((width//2, height//2))
	disp.fill(WHITE)
	disp.blit(background_river,(0,0))

	# rect1 = Rectangle(0, 0, width, 70)
	# rect1.draw(disp)
	# rect2 = Rectangle(0, (height//2)-70, width, 70 )
	# rect2.draw(disp)

	disp.blit(background_river, (0, 0))
	disp.blit(boat, (250, 170))
	rect1 = pygame.Rect(0,0,width//2, 50)
	rect2 = pygame.Rect(0,height//2-50,width//2,50)
	pygame.draw.rect(disp, (GREY_DARKER), rect1)
	pygame.draw.rect(disp, (GREY_DARKER), rect2)	

	clock = pygame.time.Clock()

	while True:

		for event in pygame.event.get():
			if event.type == pygame.QUIT:
				pygame.quit()
				sys.exit()

		surface = pygame.transform.scale(disp, (width,height))
		window.blit(surface, (0,0))

		pygame.display.update()

		clock.tick(30)



if __name__ == '__main__':
	main(initialize())